﻿using System;
using System.Web.Mvc;
using CashFlow.Entities;
using CashFlow.Entities.Models;
using CashFlow.Repository;
using CashFlow.Web.Controllers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Should.Fluent;

namespace CashFlow.Web.Tests.Controllers
{
	public class ControllerTestBase
	{
		protected static void ShouldRedirectToRouteResult(ActionResult actual, string viewName)
		{
			actual.Should().Not.Be.Null();
			var actionResult = actual as RedirectToRouteResult;
			actionResult.Should().Not.Be.Null();
			actionResult.RouteValues["action"].Should().Equal(viewName);
		}

		protected static void ShouldRedirectToView(ActionResult actual, string viewName)
		{
			actual.Should().Not.Be.Null();
			var actionResult = actual as ViewResult;
			actionResult.Should().Not.Be.Null();
			//actionResult.ViewName.Should().Equal(viewName);
		}
	}
}
